package com.gdpu.liou.symphonyserver.common.config;

import com.gdpu.liou.symphonyserver.common.interceptor.SecurityInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置类
 *
 * @author liuyx
 * @date 2022/5/18 17:01 周三
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    private final SecurityInterceptor securityInterceptor;

    public InterceptorConfig(SecurityInterceptor securityInterceptor) {
        this.securityInterceptor = securityInterceptor;
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(securityInterceptor);
    }
}
